package com.lysj.bhp.supernode.repository;

import com.lysj.bhp.supernode.domain.SuperNode;
import com.lysj.bhp.util.web.SelectItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SuperNodeRepository extends JpaRepository<SuperNode, Long>, JpaSpecificationExecutor {

    SuperNode findBySuperNodeCode(String superNodeCode);

    @Query("select new com.lysj.bhp.util.web.SelectItem(t.superNodeId AS value,t.superNodeCode AS name) from SuperNode t")
    List<SelectItem> selectItems();
}
